package com.droolsdemo.controller;

import com.droolsdemo.pojo.Person;
import com.droolsdemo.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/person")
public class PersonController {


    @Autowired
    private PersonService personService;

    @RequestMapping("/listAll")
    @ResponseBody
    public List<Person> listAll() {
        return personService.listAll();
    }

}
